home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 December / PCWorld_2005-12_cd.bin / software / temacd / tiny / tpf-6[1].5.126.exe / Tiny Firewall 2005.msi / webui.dll / WS / WSN-RULES.XSL < prev    next >
Encoding:
Extensible Markup Language  |  2005-08-17  |  46.0 KB  |  1,350 lines

  1. <?xml version="1.0"?>
  2.  
  3. <!--
  4. /*//////////////////////////////////////////////////////////////////////
  5. Filename:          wsn-rules.xsl
  6. Company Name:      Computer Associates International, Inc.
  7. Legal Copyright: Copyright (c) Computer Associates International, Inc.
  8. Author:          Ales Novak
  9. Product:          Tiny Firewall
  10. Description:      Windows Security: lists all rules by object type
  11. Last Modification: September 7, 2004
  12. Revision History:
  13.    Created July 2004
  14. ///////////////////////////////////////////////////////////////////////*/
  15.  -->
  16.  
  17. <!--//////////////////////////////////////////////////////////////////////////////////
  18. //    Parameters (passed as <root-node>/Params/Param node with @name and data as a value):
  19. //        ot => object type string, e.g. Registry
  20. //        at_XXX=<value of AT_YYY> => e.g. for AT_KEY_READ => at_KeyRead=25
  21. //        priority => high, low or normal (default)
  22. //        readonly => true/false
  23. //        usercolumn => show, showempty, hide
  24. //        otid => used for OnEditRule only, e.g. OT_REGISTRY
  25. //        editobjhdr => used for OnEditRule only, e.g. "Registry Key"
  26. //        editatcolumns => used for OnEditRule only, e.g. "Read|Create|Write|Delete"
  27. ///////////////////////////////////////////////////////////////////////////////////-->
  28.  
  29. <xsl:stylesheet version="1.0"
  30.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  31.     xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  32.     xmlns:tiny="http://tinysoftware.com/tinynamespace">
  33.  
  34.     <xsl:output method="html"/>
  35.  
  36.     <xsl:variable name="INCLUDED_FILES">../common/tools.xsl</xsl:variable>
  37.  
  38.     <!--Parameters to be passed to the XSLT transformation-->
  39.     <xsl:variable name="ot" select="//Params/Param[@name='ot']"/>
  40.     <xsl:variable name="otid" select="//Params/Param[@name='otid']"/>
  41.     <xsl:variable name="priority" select="//Params/Param[@name='priority']"/>
  42.     <xsl:variable name="readonly" select="//Params/Param[@name='readonly']"/>
  43.     <xsl:variable name="usercolumn" select="//Params/Param[@name='usercolumn']"/>
  44.     <xsl:variable name="accountcolumn" select="//Params/Param[@name='accountcolumn']"/>
  45.     <xsl:variable name="editobjhdr" select="//Params/Param[@name='editobjhdr']"/>
  46.     <xsl:variable name="editatcolumns" select="//Params/Param[@name='editatcolumns']"/>
  47.     <xsl:variable name="disableChb" select="//Params/Param[@name='disableChb']"/>
  48.     <xsl:variable name="clientrule" select="//Params/Param[@name='clientrule']"/>
  49.     <xsl:variable name="viewmode" select="//Params/Param[@name='viewmode']"/>
  50.     <xsl:variable name="easymode" select="//Params/Param[@name='easymode']"/>
  51.     <xsl:variable name="sortParam" select="//Params/Param[@name='sortParam']"/>
  52.     <xsl:variable name="proversion" select="//Params/Param[@name='proversion']"/>
  53.     <xsl:variable name="isspeditable" select="//Params/Param[@name='isspeditable']"/>
  54.     <xsl:variable name="isButtonsOnLeft" select="//Params/Param[@name='isButtonsOnLeft']"/>
  55.     <xsl:variable name="showPrefCol" select="//Params/Param[@name='showPrefCol']"/>
  56.  
  57.     <xsl:variable name="STR_ACCOUNT_SYSTEM_TIP" select="//Params/Param[@name='STR_ACCOUNT_SYSTEM_TIP']"/>
  58.     <xsl:variable name="STR_ACCOUNT_BOTH_TIP" select="//Params/Param[@name='STR_ACCOUNT_BOTH_TIP']"/>
  59.     <xsl:variable name="STR_ACCOUNT_USER_TIP" select="//Params/Param[@name='STR_ACCOUNT_USER_TIP']"/>
  60.     <xsl:variable name="STR_ACCOUNT_SYSTEM" select="//Params/Param[@name='STR_ACCOUNT_SYSTEM']"/>
  61.     <xsl:variable name="STR_ACCOUNT_BOTH" select="//Params/Param[@name='STR_ACCOUNT_BOTH']"/>
  62.     <xsl:variable name="STR_ACCOUNT_USER" select="//Params/Param[@name='STR_ACCOUNT_USER']"/>
  63.  
  64.     <xsl:variable name="STR_ACCESS_PREVENT" select="//Params/Param[@name='STR_ACCESS_PREVENT']"/>
  65.     <xsl:variable name="STR_ACCESS_ASK" select="//Params/Param[@name='STR_ACCESS_ASK']"/>
  66.     <xsl:variable name="STR_ACCESS_ALLOW" select="//Params/Param[@name='STR_ACCESS_ALLOW']"/>
  67.     <xsl:variable name="STR_AUDIT_MONITOR" select="//Params/Param[@name='STR_AUDIT_MONITOR']"/>
  68.     <xsl:variable name="STR_AUDIT_ALERT" select="//Params/Param[@name='STR_AUDIT_ALERT']"/>
  69.     <xsl:variable name="STR_AUDIT_IGNORE" select="//Params/Param[@name='STR_AUDIT_IGNORE']"/>
  70.  
  71.     <xsl:variable name="STR_DEFPOL_MOVE2DEFPOL" select="//Params/Param[@name='STR_DEFPOL_MOVE2DEFPOL']"/>
  72.     <xsl:variable name="STR_DEFPOL_MOVE2EXP" select="//Params/Param[@name='STR_DEFPOL_MOVE2EXP']"/>
  73.     <xsl:variable name="STR_RULES_MOVE_DOWN" select="//Params/Param[@name='STR_RULES_MOVE_DOWN']"/>
  74.     <xsl:variable name="STR_RULES_MOVE_UP" select="//Params/Param[@name='STR_RULES_MOVE_UP']"/>
  75.     <xsl:variable name="STR_TOOLTIP_CLONE" select="//Params/Param[@name='STR_TOOLTIP_CLONE']"/>
  76.     <xsl:variable name="STR_TOOLTIP_EDIT" select="//Params/Param[@name='STR_TOOLTIP_EDIT']"/>
  77.     <xsl:variable name="STR_TOOLTIP_DELETE" select="//Params/Param[@name='STR_TOOLTIP_DELETE']"/>
  78.     <xsl:variable name="STR_TOOLTIP_PREF" select="//Params/Param[@name='STR_TOOLTIP_PREF']"/>
  79.     <xsl:variable name="STR_TOOLTIP_CHANGE_TO_PERMANENT" select="//Params/Param[@name='STR_TOOLTIP_CHANGE_TO_PERMANENT']"/>
  80.     <xsl:variable name="STR_M2SDB_TOOLTIP" select="//Params/Param[@name='STR_M2SDB_TOOLTIP']"/>
  81.  
  82.     <xsl:variable name="STR_OPT_SEL_ALL_APP" select="//Params/Param[@name='STR_OPT_SEL_ALL_APP']"/>
  83.     <xsl:variable name="STR_OPT_SEL_ALL_DLL" select="//Params/Param[@name='STR_OPT_SEL_ALL_DLL']"/>
  84.  
  85.     <xsl:template match="/">
  86.  
  87.         <!-- sorting parameters -->
  88.         <xsl:variable name="sortCol1">
  89.             <xsl:choose>
  90.                 <xsl:when test="$sortParam = 'app'">app_id</xsl:when>
  91.                 <xsl:when test="$sortParam = '-app'">app</xsl:when>
  92.                 <xsl:when test="$sortParam = 'time'">timeofday_id</xsl:when>
  93.                 <xsl:when test="$sortParam = '-time'">timeofday</xsl:when>
  94.                 <xsl:when test="$sortParam = '-user'">filter</xsl:when>
  95.                 <xsl:when test="$sortParam = 'user'">filter</xsl:when>
  96.                 <xsl:when test="$sortParam = '-object'">obj_id</xsl:when>
  97.                 <xsl:when test="$sortParam = 'object'">obj_id</xsl:when>
  98.                 <xsl:when test="starts-with($sortParam,'-')"><xsl:value-of select="substring-after($sortParam,'-')"/></xsl:when>
  99.                 <xsl:otherwise><xsl:value-of select="$sortParam"/></xsl:otherwise>
  100.             </xsl:choose>
  101.         </xsl:variable>
  102.  
  103.         <xsl:variable name="sortCol2">
  104.             <xsl:choose>
  105.                 <xsl:when test="$sortParam = 'app'">app</xsl:when>
  106.                 <xsl:when test="$sortParam = '-app'">app_id</xsl:when>
  107.                 <xsl:when test="$sortParam = 'time'">timeofday</xsl:when>
  108.                 <xsl:when test="$sortParam = '-time'">timeofday_id</xsl:when>
  109.             </xsl:choose>
  110.         </xsl:variable>
  111.  
  112.         <xsl:variable name="sortCol3">
  113.             <xsl:if test="$sortParam='object' or $sortParam='-object'">Object</xsl:if>
  114.         </xsl:variable>
  115.  
  116.         <xsl:variable name="sortDir">
  117.             <xsl:choose>
  118.                 <xsl:when test="starts-with($sortParam,'-')">ascending</xsl:when>
  119.                 <xsl:otherwise>descending</xsl:otherwise>
  120.             </xsl:choose>
  121.         </xsl:variable>
  122.  
  123. <!--        <xsl:value-of select="$sortCol1"/>
  124.         <xsl:text>|</xsl:text>
  125.         <xsl:value-of select="$sortCol2"/>
  126.         <xsl:text>|</xsl:text>
  127.         <xsl:value-of select="$sortCol3"/>-->
  128.  
  129.         <xsl:choose>
  130.             <xsl:when test="$easymode='exp'">
  131.                 <xsl:if test="count(//RuleList/Rule[($ot = @ot) and ( ('high' = @priority) and not(@preferred=1 or @preferred='true') or ('low' = @priority) and (@preferred=1 or @preferred='true') ) ])=0">
  132.                     <xsl:call-template name="noRow"/>
  133.                 </xsl:if>
  134.  
  135.                 <xsl:for-each select="//RuleList/Rule[($ot = @ot) and ( ('high' = @priority) and not(@preferred=1 or @preferred='true') or ('low' = @priority) and (@preferred=1 or @preferred='true') ) ]">
  136.                     <xsl:variable name="className">
  137.                         <xsl:choose>
  138.                             <xsl:when test="position() mod 2 = 1">
  139.                                 <xsl:choose>
  140.                                     <xsl:when test="@priority='high'">high_row_odd</xsl:when>
  141.                                     <xsl:otherwise>odd</xsl:otherwise>
  142.                                 </xsl:choose>
  143.                             </xsl:when>
  144.                             <xsl:otherwise>
  145.                                 <xsl:choose>
  146.                                     <xsl:when test="@priority='high'">high_row_even</xsl:when>
  147.                                     <xsl:otherwise>even</xsl:otherwise>
  148.                                 </xsl:choose>
  149.                             </xsl:otherwise>
  150.                         </xsl:choose>
  151.                         <xsl:if test="@proc_id">
  152.                             <xsl:text> tmpRow</xsl:text>
  153.                         </xsl:if>
  154.                     </xsl:variable>
  155.  
  156.                     <xsl:apply-templates select=".">
  157.                         <xsl:with-param name="className" select="$className"/>
  158.                     </xsl:apply-templates>
  159.  
  160.                 </xsl:for-each>
  161.             </xsl:when>
  162.  
  163.             <xsl:when test="$easymode='defpol'">
  164.                 <xsl:if test="count(//RuleList/Rule[($ot = @ot) and ( ('high' = @priority) and (@preferred=1 or @preferred='true') or ('low' = @priority) and not(@preferred=1 or @preferred='true') ) ])=0">
  165.                     <xsl:call-template name="noRow"/>
  166.                 </xsl:if>
  167.  
  168.                 <xsl:for-each select="//RuleList/Rule[($ot = @ot) and ( ('high' = @priority) and (@preferred=1 or @preferred='true') or ('low' = @priority) and not(@preferred=1 or @preferred='true') ) ]">
  169.  
  170.                     <xsl:variable name="className">
  171.                         <xsl:choose>
  172.                             <xsl:when test="position() mod 2 = 1">
  173.                                 <xsl:choose>
  174.                                     <xsl:when test="@priority='high'">high_row_odd</xsl:when>
  175.                                     <xsl:otherwise>odd</xsl:otherwise>
  176.                                 </xsl:choose>
  177.                             </xsl:when>
  178.                             <xsl:otherwise>
  179.                                 <xsl:choose>
  180.                                     <xsl:when test="@priority='high'">high_row_even</xsl:when>
  181.                                     <xsl:otherwise>even</xsl:otherwise>
  182.                                 </xsl:choose>
  183.                             </xsl:otherwise>
  184.                         </xsl:choose>
  185.                         <xsl:if test="@proc_id">
  186.                             <xsl:text> tmpRow</xsl:text>
  187.                         </xsl:if>
  188.                     </xsl:variable>
  189.  
  190.                     <xsl:apply-templates select=".">
  191.                         <xsl:with-param name="className" select="$className"/>
  192.                     </xsl:apply-templates>
  193.  
  194.                 </xsl:for-each>
  195.             </xsl:when>
  196.  
  197.             <xsl:otherwise>
  198.                 <xsl:if test="count(//RuleList/Rule[($ot = @ot) and (not($priority) or ($priority = @priority))])=0">
  199.                     <xsl:call-template name="noRow"/>
  200.                 </xsl:if>
  201.  
  202.                 <xsl:for-each select="//RuleList/Rule[($ot = @ot) and (not($priority) or ($priority = @priority))]">
  203.                     <xsl:sort select="@*[name()=$sortCol1] | AccessDesc/@*[name()=$sortCol1]" order="{$sortDir}"/>
  204.                     <xsl:sort select="@*[name()=$sortCol2]" order="{$sortDir}"/>
  205.                     <xsl:sort select="*[name()=$sortCol3]" order="{$sortDir}"/>
  206.  
  207.                     <xsl:variable name="className">
  208.                         <xsl:choose>
  209.                             <xsl:when test="position() mod 2 = 1">odd</xsl:when>
  210.                             <xsl:otherwise>even</xsl:otherwise>
  211.                         </xsl:choose>
  212.  
  213.                         <xsl:if test="@proc_id">
  214.                             <xsl:text> tmpRow</xsl:text>
  215.                         </xsl:if>
  216.                     </xsl:variable>
  217.  
  218.                     <xsl:apply-templates select=".">
  219.                         <xsl:with-param name="className" select="$className"/>
  220.                     </xsl:apply-templates>
  221.  
  222.                 </xsl:for-each>
  223.             </xsl:otherwise>
  224.         </xsl:choose>
  225.     </xsl:template>
  226.  
  227.     <xsl:template match="Rule">
  228.         <xsl:param name="className"/>
  229.  
  230.         <xsl:variable name="simplerule">
  231.             <xsl:if test="$ot='File' and $proversion='true'">
  232.                 <xsl:if test="starts-with( @desc, '@@:')">
  233.                     <xsl:text>true</xsl:text>
  234.                 </xsl:if>
  235.             </xsl:if>
  236.         </xsl:variable>
  237.  
  238.         <xsl:choose>
  239.             <xsl:when test="$viewmode=1 or ($viewmode=2 and ($readonly='true' or $simplerule='true'))">
  240.                 <xsl:apply-templates select="." mode="detail_readonly">
  241.                     <xsl:with-param name="className" select="$className"/>
  242.                     <xsl:with-param name="simplerule" select="$simplerule"/>
  243.                 </xsl:apply-templates>
  244.  
  245.             </xsl:when>
  246.  
  247.             <xsl:when test="$viewmode=2">
  248.                 <xsl:apply-templates select="." mode="detail_editable">
  249.                     <xsl:with-param name="className" select="$className"/>
  250.                 </xsl:apply-templates>
  251.             </xsl:when>
  252.  
  253.             <xsl:otherwise>
  254.                 <xsl:choose>
  255.                     <xsl:when test="$readonly='true' or $simplerule='true'">
  256.                         <xsl:apply-templates select="." mode="simple_readonly">
  257.                             <xsl:with-param name="className" select="$className"/>
  258.                         </xsl:apply-templates>
  259.                     </xsl:when>
  260.  
  261.                     <xsl:otherwise>
  262.                         <xsl:apply-templates select="." mode="simple_editable">
  263.                             <xsl:with-param name="className" select="$className"/>
  264.                         </xsl:apply-templates>
  265.                     </xsl:otherwise>
  266.                 </xsl:choose>
  267.             </xsl:otherwise>
  268.         </xsl:choose>
  269.     </xsl:template>
  270.  
  271.     <xsl:template name="noRow">
  272.         <tr class="odd">
  273.             <td colspan="18" class="nomenu">
  274.                 <xsl:value-of select="//Params/Param[@name='STR_NO_RULE']"/>
  275.             </td>
  276.         </tr>
  277.     </xsl:template>
  278.  
  279.     <xsl:template name="getAccountTip">
  280.         <xsl:param name="strAccount"/>
  281.  
  282.         <xsl:choose>
  283.             <xsl:when test="$strAccount='system'">
  284.                 <xsl:value-of select="$STR_ACCOUNT_SYSTEM_TIP"/>
  285.             </xsl:when>
  286.  
  287.             <xsl:when test="$strAccount='both'">
  288.                 <xsl:value-of select="$STR_ACCOUNT_BOTH_TIP"/>
  289.             </xsl:when>
  290.  
  291.             <xsl:otherwise>
  292.                 <xsl:value-of select="$STR_ACCOUNT_USER_TIP"/>
  293.             </xsl:otherwise>
  294.         </xsl:choose>
  295.     </xsl:template>
  296.  
  297.     <xsl:template name="getAccountText">
  298.         <xsl:param name="strAccount"/>
  299.  
  300.         <xsl:choose>
  301.             <xsl:when test="$strAccount='system'">
  302.                 <xsl:value-of select="$STR_ACCOUNT_SYSTEM"/>
  303.             </xsl:when>
  304.  
  305.             <xsl:when test="$strAccount='both'">
  306.                 <xsl:value-of select="$STR_ACCOUNT_BOTH"/>
  307.             </xsl:when>
  308.  
  309.             <xsl:otherwise>
  310.                 <xsl:value-of disable-output-escaping="yes" select="$STR_ACCOUNT_USER"/>
  311.             </xsl:otherwise>
  312.         </xsl:choose>
  313.     </xsl:template>
  314.  
  315.     <xsl:template name="getAccessImg">
  316.         <xsl:param name="ar"/>
  317.  
  318.         <xsl:choose>
  319.             <xsl:when test="$ar = 'Prevent'">
  320.                 <img src="../img/prevent.gif" width="16" height="16">
  321.                     <xsl:attribute name="title">
  322.                         <xsl:value-of select="$STR_ACCESS_PREVENT"/>
  323.                     </xsl:attribute>
  324.                 </img>
  325.             </xsl:when>
  326.             <xsl:when test="$ar = 'AskUser'">
  327.                 <img src="../img/askuser.gif" width="16" height="16">
  328.                     <xsl:attribute name="title">
  329.                         <xsl:value-of select="$STR_ACCESS_ASK"/>
  330.                     </xsl:attribute>
  331.                 </img>
  332.             </xsl:when>
  333.             <xsl:otherwise>
  334.                 <img src="../img/allow.gif" width="16" height="16">
  335.                     <xsl:attribute name="title">
  336.                         <xsl:value-of select="$STR_ACCESS_ALLOW"/>
  337.                     </xsl:attribute>
  338.                 </img>
  339.             </xsl:otherwise>
  340.         </xsl:choose>
  341.     </xsl:template>
  342.  
  343.     <xsl:template name="getAuditImg">
  344.         <xsl:param name="al"/>
  345.  
  346.         <xsl:choose>
  347.             <xsl:when test="$al = 'Monitor'">
  348.                 <img src="../img/monitor.gif" width="16" height="16">
  349.                     <xsl:attribute name="title">
  350.                         <xsl:value-of select="$STR_AUDIT_MONITOR"/>
  351.                     </xsl:attribute>
  352.                 </img>
  353.             </xsl:when>
  354.             <xsl:when test="$al = 'Alert'">
  355.                 <img src="../img/alert.gif" width="16" height="16">
  356.                     <xsl:attribute name="title">
  357.                         <xsl:value-of select="$STR_AUDIT_ALERT"/>
  358.                     </xsl:attribute>
  359.                 </img>
  360.             </xsl:when>
  361.             <xsl:otherwise>
  362.                 <img src="../img/ignore.gif" width="16" height="16">
  363.                     <xsl:attribute name="title">
  364.                         <xsl:value-of select="$STR_AUDIT_IGNORE"/>
  365.                     </xsl:attribute>
  366.                 </img>
  367.             </xsl:otherwise>
  368.         </xsl:choose>
  369.     </xsl:template>
  370.  
  371.  
  372.     <xsl:template name="getAuditTip">
  373.         <xsl:param name="al"/>
  374.  
  375.         <xsl:choose>
  376.             <xsl:when test="$al = 'Monitor'">
  377.                 <xsl:value-of select="$STR_AUDIT_MONITOR"/>
  378.             </xsl:when>
  379.             <xsl:when test="$al = 'Alert'">
  380.                 <xsl:value-of select="$STR_AUDIT_ALERT"/>
  381.             </xsl:when>
  382.             <xsl:otherwise>
  383.                 <xsl:value-of select="$STR_AUDIT_IGNORE"/>
  384.             </xsl:otherwise>
  385.         </xsl:choose>
  386.     </xsl:template>
  387.  
  388.  
  389.     <xsl:template name="getAccessTip">
  390.         <xsl:param name="ar"/>
  391.  
  392.         <xsl:choose>
  393.             <xsl:when test="$ar = 'Prevent'">
  394.                 <xsl:value-of select="$STR_ACCESS_PREVENT"/>
  395.             </xsl:when>
  396.             <xsl:when test="$ar = 'AskUser'">
  397.                 <xsl:value-of select="$STR_ACCESS_ASK"/>
  398.             </xsl:when>
  399.             <xsl:otherwise>
  400.                 <xsl:value-of select="$STR_ACCESS_ALLOW"/>
  401.             </xsl:otherwise>
  402.         </xsl:choose>
  403.     </xsl:template>
  404.  
  405.     <!--showAccess - draws ar/al icons for particular access type (at is distinguished by input parameter at & atid)  -->
  406.     <xsl:template match="Rule" mode="showAccess">
  407.         <!-- parameters at => e.g. KeyRead, atid => e.g. 25, ruleid => e.g. FS15 -->
  408.         <xsl:param name="at" select="0"/>
  409.         <xsl:param name="atid" select="0"/>
  410.         <xsl:param name="ruleid" select="0"/>
  411.         <xsl:param name="readonlyloc" select="0"/>
  412.  
  413.         <td style="white-space: nowrap;" class="nomenu">
  414.  
  415.             <xsl:variable name="atcondition" select="AccessDesc[(@at = '*') or (@at = $at)]"/>
  416.  
  417.             <xsl:choose>
  418.                 <!-- if this access is present (or '*' is present), then find out the values -->
  419.                 <xsl:when test="count($atcondition)">
  420.                     <xsl:for-each select="$atcondition">
  421.                         <xsl:choose>
  422.                             <!-- for SpawnProcInOwnSbx display checkbox instead of icons -->
  423.                             <xsl:when test="@at = 'SpawnProcInOwnSbx'">
  424.                                 <input type="checkbox" onclick="OnParentSbxClick(this, '{$ruleid}');">
  425.                                     <xsl:choose>
  426.                                         <xsl:when test="@ar = 'Prevent'">
  427.                                             <xsl:attribute name="checked"/>
  428.                                             <xsl:attribute name="title">
  429.                                                 <xsl:value-of select="//Params/Param[@name='STR_RULES_PARENT_SEC_CONTEXT']"/>
  430.                                             </xsl:attribute>
  431.                                         </xsl:when>
  432.                                         <xsl:otherwise>
  433.                                             <xsl:attribute name="title">
  434.                                                 <xsl:value-of select="//Params/Param[@name='STR_RULES_NORMAL_SEC_CONTEXT']"/>
  435.                                             </xsl:attribute>
  436.                                         </xsl:otherwise>
  437.                                     </xsl:choose>
  438.  
  439.                                     <xsl:if test="$readonlyloc='true' or $readonly='true'">
  440.                                         <xsl:attribute name="disabled"/>
  441.                                     </xsl:if>
  442.  
  443.                                 </input>
  444.                             </xsl:when>
  445.                             <xsl:otherwise>
  446.                                 <xsl:choose>
  447.                                     <xsl:when test="$readonlyloc='true' or $readonly='true'">
  448.                                         <span style="padding: 3px; width: 50%">
  449.                                             <xsl:call-template name="getAccessImg">
  450.                                                 <xsl:with-param name="ar" select="@ar"/>
  451.                                             </xsl:call-template>
  452.                                         </span>
  453.                                     </xsl:when>
  454.  
  455.                                     <xsl:otherwise>
  456.                                         <a href="#" style="width: 50%;" onclick="FloatMenu_initAccess('{$ruleid}','{$priority}'=='high', {$atid}, {$clientrule}); toggleFloatMenu(this, 'arMenu', 'table_rules', 'rules'); return false;">
  457.                                             <xsl:call-template name="getAccessImg">
  458.                                                 <xsl:with-param name="ar" select="@ar"/>
  459.                                             </xsl:call-template>
  460.                                         </a>
  461.                                     </xsl:otherwise>
  462.                                 </xsl:choose>
  463.                             </xsl:otherwise>
  464.                         </xsl:choose>
  465.  
  466.                         <xsl:choose>
  467.                             <xsl:when test="$readonlyloc='true' or $readonly='true'">
  468.                                 <span style="padding: 3px; width: 50%">
  469.                                     <xsl:call-template name="getAuditImg">
  470.                                         <xsl:with-param name="al" select="@al"/>
  471.                                     </xsl:call-template>
  472.                                 </span>
  473.                             </xsl:when>
  474.  
  475.                             <xsl:otherwise>
  476.                                 <a href="#" style="width: 50%;" onclick="FloatMenu_initAudit( '{$ruleid}', {$atid}, {$clientrule}); toggleFloatMenu(this, 'alMenu','table_rules','rules'); return false;">
  477.                                     <xsl:call-template name="getAuditImg">
  478.                                         <xsl:with-param name="al" select="@al"/>
  479.                                     </xsl:call-template>
  480.                                 </a>
  481.                             </xsl:otherwise>
  482.                         </xsl:choose>
  483.                     </xsl:for-each>
  484.                 </xsl:when>
  485.  
  486.                 <!-- if this access is not present => it means Allow/Ignore -->
  487.                 <xsl:otherwise>
  488.                     <xsl:choose>
  489.                         <!-- for SpawnProcInOwnSbx display checkbox instead of icons -->
  490.                         <xsl:when test="$at = 'SpawnProcInOwnSbx'">
  491.                             <input type="checkbox" onclick="OnParentSbxClick(this, '{$ruleid}');">
  492.  
  493.                                 <xsl:attribute name="title">
  494.                                     <xsl:value-of select="//Params/Param[@name='STR_RULES_NORMAL_SEC_CONTEXT']"/>
  495.                                 </xsl:attribute>
  496.  
  497.                                 <xsl:if test="$readonlyloc='true' or $readonly='true'">
  498.                                     <xsl:attribute name="disabled"/>
  499.                                 </xsl:if>
  500.  
  501.                             </input>
  502.                         </xsl:when>
  503.  
  504.                         <xsl:otherwise>
  505.                             <xsl:choose>
  506.                                 <xsl:when test="$readonlyloc='true' or $readonly='true'">
  507.                                     <span style="padding: 3px; width: 50%">
  508.                                         <xsl:call-template name="getAccessImg">
  509.                                             <xsl:with-param name="ar" select="'Allow'"/>
  510.                                         </xsl:call-template>
  511.                                     </span>
  512.                                 </xsl:when>
  513.  
  514.                                 <xsl:otherwise>
  515.                                     <a href="#" style="width: 50%;" onclick="FloatMenu_initAccess('{$ruleid}','{$priority}'=='high', {$atid}, {$clientrule}); toggleFloatMenu(this, 'arMenu', 'table_rules', 'rules'); return false;">
  516.                                         <xsl:call-template name="getAccessImg">
  517.                                             <xsl:with-param name="ar" select="'Allow'"/>
  518.                                         </xsl:call-template>
  519.                                     </a>
  520.                                 </xsl:otherwise>
  521.                             </xsl:choose>
  522.                         </xsl:otherwise>
  523.                     </xsl:choose>
  524.  
  525.                     <xsl:choose>
  526.                         <xsl:when test="$readonlyloc='true' or $readonly='true'">
  527.                             <span style="padding: 3px; width: 50%">
  528.                                 <xsl:call-template name="getAuditImg">
  529.                                     <xsl:with-param name="al" select="'Ignore'"/>
  530.                                 </xsl:call-template>
  531.                             </span>
  532.                         </xsl:when>
  533.  
  534.                         <xsl:otherwise>
  535.                             <a href="#" style="width: 50%;" onclick="FloatMenu_initAudit( '{$ruleid}', {$atid}, {$clientrule}); toggleFloatMenu(this, 'alMenu','table_rules','rules'); return false;">
  536.                                 <xsl:call-template name="getAuditImg">
  537.                                     <xsl:with-param name="al" select="'Ignore'"/>
  538.                                 </xsl:call-template>
  539.                             </a>
  540.                         </xsl:otherwise>
  541.                     </xsl:choose>
  542.                 </xsl:otherwise>
  543.             </xsl:choose>
  544.         </td>
  545.     </xsl:template>
  546.  
  547.  
  548.     <xsl:template match="Rule" mode="showAccessTooltip">
  549.         <!-- parameters at => e.g. KeyRead, atid => e.g. 25, ruleid => e.g. FS15 -->
  550.         <xsl:param name="at" select="0"/>
  551.         <xsl:param name="atid" select="0"/>
  552.  
  553.  
  554.             <xsl:variable name="atcondition" select="AccessDesc[(@at = '*') or (@at = $at)]"/>
  555.  
  556.             <xsl:choose>
  557.                 <!-- if this access is present (or '*' is present), then find out the values -->
  558.                 <xsl:when test="count($atcondition)">
  559.                     <xsl:for-each select="$atcondition">
  560.                         <xsl:choose>
  561.                             <!-- for SpawnProcInOwnSbx display checkbox instead of icons -->
  562.                             <xsl:when test="@at = 'SpawnProcInOwnSbx'">
  563.  
  564.                                 <xsl:choose>
  565.                                     <xsl:when test="@ar = 'Prevent'">
  566.                                         <xsl:value-of select="//Params/Param[@name='STR_RULES_PARENT_SEC_CONTEXT']"/>
  567.                                     </xsl:when>
  568.                                     <xsl:otherwise>
  569.                                         <xsl:value-of select="//Params/Param[@name='STR_RULES_NORMAL_SEC_CONTEXT']"/>
  570.                                     </xsl:otherwise>
  571.                                 </xsl:choose>
  572.                                 <xsl:text>, </xsl:text>
  573.                             </xsl:when>
  574.  
  575.                             <xsl:otherwise>
  576.                                 <xsl:call-template name="getAccessTip">
  577.                                     <xsl:with-param name="ar" select="@ar"/>
  578.                                 </xsl:call-template>
  579.                                 <xsl:text>, </xsl:text>
  580.                             </xsl:otherwise>
  581.                         </xsl:choose>
  582.  
  583.                         <xsl:call-template name="getAuditTip">
  584.                             <xsl:with-param name="al" select="@al"/>
  585.                         </xsl:call-template>
  586.  
  587.                     </xsl:for-each>
  588.                 </xsl:when>
  589.  
  590.                 <!-- if this access is not present => it means Allow/Ignore -->
  591.                 <xsl:otherwise>
  592.                     <xsl:choose>
  593.                         <!-- for SpawnProcInOwnSbx display checkbox instead of icons -->
  594.                         <xsl:when test="$at = 'SpawnProcInOwnSbx'">
  595.                             <xsl:value-of select="//Params/Param[@name='STR_RULES_NORMAL_SEC_CONTEXT']"/>
  596.                             <xsl:text>, </xsl:text>
  597.                         </xsl:when>
  598.  
  599.                         <xsl:otherwise>
  600.                             <xsl:call-template name="getAccessTip">
  601.                                 <xsl:with-param name="ar" select="'Allow'"/>
  602.                             </xsl:call-template>
  603.                             <xsl:text>, </xsl:text>
  604.                         </xsl:otherwise>
  605.                     </xsl:choose>
  606.  
  607.                     <xsl:call-template name="getAuditTip">
  608.                         <xsl:with-param name="al" select="'Ignore'"/>
  609.                     </xsl:call-template>
  610.  
  611.                 </xsl:otherwise>
  612.             </xsl:choose>
  613.  
  614.     </xsl:template>
  615.  
  616.  
  617.     <xsl:template match="Rule" mode="getBtns">
  618.         <xsl:param name="priority"/>
  619.  
  620.         <xsl:choose>
  621.             <xsl:when test="@proc_id">
  622.                 <a href="#" onclick="WS_CreatePermanentRule('{@id}',{$clientrule}); return false;">
  623.                     <img src="../img/ico-save.gif">
  624.                         <xsl:attribute name="alt">
  625.                             <xsl:value-of select="$STR_TOOLTIP_CHANGE_TO_PERMANENT"/>
  626.                         </xsl:attribute>
  627.                     </img>
  628.                 </a>
  629.             </xsl:when>
  630.             <xsl:when test="$clientrule='true' and $isspeditable='true'">
  631.                 <a href="#" onclick="WS_MoveToServerDB('{@id}'); return false;">
  632.                     <img src="../img/ico-movetoserverdb.gif">
  633.                         <xsl:attribute name="alt">
  634.                             <xsl:value-of select="$STR_M2SDB_TOOLTIP"/>
  635.                         </xsl:attribute>
  636.                     </img>
  637.                 </a>
  638.             </xsl:when>
  639.         </xsl:choose>
  640.  
  641.         <xsl:choose>
  642.  
  643.             <xsl:when test="$easymode='exp'">
  644.                 <a href="#" onclick="WS_SwitchEasyRule( '{@id}' ); Reload('{@id}'); return false;">
  645.                     <img src="../img/ico-down.gif" width="16" height="16">
  646.                         <xsl:attribute name="title">
  647.                             <xsl:value-of select="$STR_DEFPOL_MOVE2DEFPOL"/>
  648.                         </xsl:attribute>
  649.                     </img>
  650.                 </a>
  651.             </xsl:when>
  652.  
  653.             <xsl:when test="$easymode='defpol'">
  654.                 <a href="#" onclick="WS_SwitchEasyRule( '{@id}' ); Reload('{@id}'); return false;">
  655.                     <img src="../img/ico-up.gif" width="16" height="16">
  656.                         <xsl:attribute name="title">
  657.                             <xsl:value-of select="$STR_DEFPOL_MOVE2EXP"/>
  658.                         </xsl:attribute>
  659.                     </img>
  660.                 </a>
  661.             </xsl:when>
  662.  
  663.             <xsl:otherwise>
  664.                 <xsl:if test="$priority='high' or $priority='low'">
  665.                     <a href="#" onclick="OnChangeRulePriority( '{@id}' ); return false;">
  666.                         <xsl:choose>
  667.                             <xsl:when test="$priority='high'">
  668.                                 <img src="../img/ico-down.gif" width="16" height="16">
  669.                                     <xsl:attribute name="title">
  670.                                         <xsl:value-of select="$STR_RULES_MOVE_DOWN"/>
  671.                                     </xsl:attribute>
  672.                                 </img>
  673.                             </xsl:when>
  674.                             <xsl:otherwise>
  675.                                 <img src="../img/ico-up.gif" width="16" height="16">
  676.                                     <xsl:attribute name="title">
  677.                                         <xsl:value-of select="$STR_RULES_MOVE_UP"/>
  678.                                     </xsl:attribute>
  679.                                 </img>
  680.                             </xsl:otherwise>
  681.                         </xsl:choose>
  682.                     </a>
  683.                 </xsl:if>
  684.             </xsl:otherwise>
  685.         </xsl:choose>
  686.  
  687.         <xsl:variable name="allaccesses">
  688.             <xsl:apply-templates select="//Params" mode="allaccesses"/>
  689.         </xsl:variable>
  690.  
  691.         <a href="#" onclick="OnCloneRule('{@id}',{$clientrule}); return false;">
  692.             <img src="../img/ico_copy.gif" width="16" height="16">
  693.                 <xsl:attribute name="title">
  694.                     <xsl:value-of select="$STR_TOOLTIP_CLONE"/>
  695.                 </xsl:attribute>
  696.             </img>
  697.         </a>
  698.  
  699.         <a href="#" onclick="OnEditRule( '{@id}', '{$priority}' != 'low' && '{$priority}' != 'high','{$ot}', '{$otid}', '{$allaccesses}', '{$editobjhdr}', '{$editatcolumns}' ); return false;">
  700.             <img src="../img/ico-edit.gif" width="16" height="16">
  701.                 <xsl:attribute name="title">
  702.                     <xsl:value-of select="$STR_TOOLTIP_EDIT"/>
  703.                 </xsl:attribute>
  704.             </img>
  705.         </a>
  706.  
  707.         <a href="#" onclick="OnDeleteRule( '{@id}' ); return false;">
  708.             <img src="../img/ico-remove.gif" width="16" height="16">
  709.                 <xsl:attribute name="title">
  710.                     <xsl:value-of select="$STR_TOOLTIP_DELETE"/>
  711.                 </xsl:attribute>
  712.             </img>
  713.         </a>
  714.  
  715.         <input type="checkbox" name="_batch_rule_sign" value="{@id}" clientRule="{$clientrule}" style="display: none;"/>
  716.     </xsl:template>
  717.  
  718.     <!-- Rule template - called from the \ template -->
  719.     <xsl:template match="Rule" mode="simple_editable">
  720.         <xsl:param name="className"/>
  721.  
  722.         <!-- modify the row background color according to $ or even line -->
  723.         <tr id="_rule_{@id}" ruleId="{@id}" class="{$className}">
  724.             <xsl:attribute name="title">
  725.                 <xsl:apply-templates select="." mode="tooltip">
  726.                     <xsl:with-param name="detail" select="'false'"/>
  727.                 </xsl:apply-templates>
  728.             </xsl:attribute>
  729.  
  730.             <!-- first column is the 'rule enable' checkbox + the rule id -->
  731.             <td>
  732.                 <input type="checkbox" align="absmiddle" onclick="OnDisableEnableRule( '{@id}', this.checked )">
  733.                     <xsl:attribute name="title">
  734.                         <xsl:value-of select="//Params/Param[@name='STR_RULES_ENABLE_TIP']"/>
  735.                     </xsl:attribute>
  736.  
  737.                     <xsl:if test="(@disabled = '0') or not(@disabled)">
  738.                         <xsl:attribute name="checked"/>
  739.                     </xsl:if>
  740.  
  741.                     <xsl:if test="$disableChb='true'">
  742.                         <xsl:attribute name="disabled"/>
  743.                     </xsl:if>
  744.                 </input>
  745.             </td>
  746.  
  747.             <!-- move-to, edit and delete icons-->
  748.             <xsl:if test="$isButtonsOnLeft='true'">
  749.                 <td class="action" style="text-align: left;">
  750.                     <xsl:apply-templates select="." mode="getBtns">
  751.                         <xsl:with-param name="priority" select="@priority"/>
  752.                     </xsl:apply-templates>
  753.                 </td>
  754.             </xsl:if>
  755.  
  756.             <td class="nomenu">
  757.  
  758.                 <xsl:choose>
  759.                     <xsl:when test="$ot = 'File' and starts-with( @desc, '@@:')">
  760.                         <xsl:value-of select="//Params/Param[@name='STR_FRS_CANNOT_EDIT']"/>
  761.                     </xsl:when>
  762.                     <xsl:otherwise>
  763.                         <xsl:value-of select="@desc"/>
  764.                     </xsl:otherwise>
  765.                 </xsl:choose>
  766.  
  767.             </td>
  768.  
  769.             <!-- time of day -->
  770.             <td style="white-space : nowrap;">
  771.  
  772.                 <a href="#" onclick="FloatMenu_initTime('{@id}', {$clientrule}, ''); toggleFloatMenu(this, 'timeMenu','table_rules','rules'); return false;">
  773.                     <xsl:choose>
  774.                         <xsl:when test="@timeofday_id">
  775.                             <xsl:value-of select="@timeofday_id"/>
  776.                         </xsl:when>
  777.                         <xsl:when test="not(@timeofday='*')">
  778.                             <xsl:call-template name="formatDaytime">
  779.                                 <xsl:with-param name="daytime" select="@timeofday"/>
  780.                             </xsl:call-template>
  781.                         </xsl:when>
  782.                     </xsl:choose>
  783.                 </a>
  784.             </td>
  785.  
  786.             <!-- optional User column -->
  787.             <xsl:if test="($usercolumn = 'show') or ($usercolumn = 'showempty')">
  788.                 <td>
  789.                     <xsl:if test="$usercolumn = 'show'">
  790.                         <xsl:if test="not($clientrule='true')">
  791.  
  792.                             <a href="#" onclick="FloatMenu_initUsers('{@id}', ''); toggleFloatMenu(this, 'usersMenu', 'table_rules', 'rules'); return false;">
  793.                                 <xsl:call-template name="replaceWithBR">
  794.                                     <xsl:with-param name="string" select="@filter"/>
  795.                                     <xsl:with-param name="what" select="'|'"/>
  796.                                 </xsl:call-template>
  797.                             </a>
  798.                         </xsl:if>
  799.                     </xsl:if>
  800.                 </td>
  801.             </xsl:if>
  802.  
  803.             <!-- move-to, edit and delete icons-->
  804.             <xsl:if test="$isButtonsOnLeft!='true'">
  805.                 <td class="action" style="text-align: right;">
  806.                     <xsl:apply-templates select="." mode="getBtns">
  807.                         <xsl:with-param name="priority" select="@priority"/>
  808.                     </xsl:apply-templates>
  809.                 </td>
  810.             </xsl:if>
  811.         </tr>
  812.  
  813.     </xsl:template>
  814.  
  815.     <xsl:template match="Rule" mode="simple_readonly">
  816.         <xsl:param name="className"/>
  817.  
  818.         <!-- modify the row background color according to $ or even line -->
  819.         <tr id="_rule_{@id}" ruleId="{@id}" class="{$className}">
  820.             <xsl:attribute name="title">
  821.                 <xsl:apply-templates select="." mode="tooltip">
  822.                     <xsl:with-param name="detail" select="'false'"/>
  823.                 </xsl:apply-templates>
  824.             </xsl:attribute>
  825.  
  826.             <!-- first column is the 'rule enable' checkbox + the rule id -->
  827.             <td>
  828.                 <input disabled="disabled" type="checkbox" align="absmiddle" onclick="OnDisableEnableRule( '{@id}', this.checked )">
  829.                     <xsl:attribute name="title">
  830.                         <xsl:value-of select="//Params/Param[@name='STR_RULES_ENABLE_TIP']"/>
  831.                     </xsl:attribute>
  832.  
  833.                     <xsl:if test="(@disabled = '0') or not(@disabled)">
  834.                         <xsl:attribute name="checked"/>
  835.                     </xsl:if>
  836.  
  837.                 </input>
  838.             </td>
  839.  
  840.             <xsl:if test="$isButtonsOnLeft='true'">
  841.                 <!-- move-to, edit and delete icons-->
  842.                 <td class="action" style="text-align: right;">
  843.                 </td>
  844.             </xsl:if>
  845.  
  846.             <td class="nomenu">
  847.                 <xsl:choose>
  848.                     <xsl:when test="$ot = 'File' and starts-with( @desc, '@@:')">
  849.                         <xsl:value-of select="//Params/Param[@name='STR_FRS_CANNOT_EDIT']"/>
  850.                     </xsl:when>
  851.                     <xsl:otherwise>
  852.                         <xsl:value-of select="@desc"/>
  853.                     </xsl:otherwise>
  854.                 </xsl:choose>
  855.             </td>
  856.  
  857.             <!-- time of day -->
  858.             <td style="white-space : nowrap;" class="nomenu">
  859.  
  860.                 <xsl:choose>
  861.                     <xsl:when test="@timeofday_id">
  862.                         <xsl:value-of select="@timeofday_id"/>
  863.                     </xsl:when>
  864.                     <xsl:when test="not(@timeofday='*')">
  865.                         <xsl:call-template name="formatDaytime">
  866.                             <xsl:with-param name="daytime" select="@timeofday"/>
  867.                         </xsl:call-template>
  868.                     </xsl:when>
  869.                 </xsl:choose>
  870.  
  871.             </td>
  872.  
  873.             <!-- optional User column -->
  874.             <xsl:if test="($usercolumn = 'show') or ($usercolumn = 'showempty')">
  875.                 <td class="nomenu">
  876.                     <xsl:if test="$usercolumn = 'show'">
  877.                         <xsl:call-template name="replaceWithBR">
  878.                             <xsl:with-param name="string" select="@filter"/>
  879.                             <xsl:with-param name="what" select="'|'"/>
  880.                         </xsl:call-template>
  881.                     </xsl:if>
  882.                 </td>
  883.             </xsl:if>
  884.  
  885.             <xsl:if test="$isButtonsOnLeft!='true'">
  886.                 <!-- move-to, edit and delete icons-->
  887.                 <td class="action" style="text-align: right;">
  888.                 </td>
  889.             </xsl:if>
  890.         </tr>
  891.  
  892.     </xsl:template>
  893.  
  894.     <xsl:template match="Rule" mode="getObjValue">
  895.         <xsl:variable name="value">
  896.             <xsl:choose>
  897.                 <xsl:when test="Object">
  898.                     <xsl:value-of select="Object"/>
  899.                 </xsl:when>
  900.                 <xsl:otherwise>
  901.                     <xsl:value-of select="@obj_id"/>
  902.                 </xsl:otherwise>
  903.             </xsl:choose>
  904.         </xsl:variable>
  905.  
  906.         <xsl:choose>
  907.             <xsl:when test="$value='*' and $ot='DllLoading'">
  908.                 <xsl:choose>
  909.                     <xsl:when test="@dllobj=1 or @dllobj='true'">
  910.                         <xsl:value-of select="$STR_OPT_SEL_ALL_DLL"/>
  911.                     </xsl:when>
  912.                     <xsl:otherwise>
  913.                         <xsl:value-of select="$STR_OPT_SEL_ALL_APP"/>
  914.                     </xsl:otherwise>
  915.                 </xsl:choose>
  916.             </xsl:when>
  917.             <xsl:otherwise>
  918.                 <xsl:value-of select="$value"/>
  919.             </xsl:otherwise>
  920.         </xsl:choose>
  921.     </xsl:template>
  922.  
  923.     <xsl:template match="Rule" mode="detail_editable">
  924.         <xsl:param name="className"/>
  925.  
  926.         <!-- modify the row background color according to $ or even line -->
  927.         <tr id="_rule_{@id}" ruleId="{@id}" class="{$className}">
  928.             <xsl:attribute name="title">
  929.                 <xsl:apply-templates select="." mode="tooltip">
  930.                     <xsl:with-param name="detail" select="'true'"/>
  931.                 </xsl:apply-templates>
  932.             </xsl:attribute>
  933.  
  934.             <!-- first column is the 'rule enable' checkbox + the rule id -->
  935.             <td>
  936.                 <input type="checkbox" align="absmiddle" onclick="OnDisableEnableRule( '{@id}', this.checked )">
  937.                     <xsl:attribute name="title">
  938.                         <xsl:value-of select="//Params/Param[@name='STR_RULES_ENABLE_TIP']"/>
  939.                     </xsl:attribute>
  940.  
  941.                     <xsl:if test="(@disabled = '0') or not(@disabled)">
  942.                         <xsl:attribute name="checked"/>
  943.                     </xsl:if>
  944.  
  945.                     <xsl:if test="$disableChb='true'">
  946.                         <xsl:attribute name="disabled"/>
  947.                     </xsl:if>
  948.                 </input>
  949.             </td>
  950.  
  951.             <xsl:if test="$showPrefCol='true'">
  952.                 <td>
  953.                     <xsl:if test="not($clientrule='true') and (@preferred='1' or @preferred='true')">
  954.                         <img src="../img/ico-pref.gif">
  955.                             <xsl:attribute name="title">
  956.                                 <xsl:value-of select="$STR_TOOLTIP_PREF"/>
  957.                             </xsl:attribute>
  958.                         </img>
  959.                     </xsl:if>
  960.                 </td>
  961.             </xsl:if>
  962.  
  963.             <!-- move-to, edit and delete icons-->
  964.             <xsl:if test="$isButtonsOnLeft='true'">
  965.                 <td class="action" style="text-align: left;">
  966.                     <xsl:apply-templates select="." mode="getBtns">
  967.                         <xsl:with-param name="priority" select="@priority"/>
  968.                     </xsl:apply-templates>
  969.                 </td>
  970.             </xsl:if>
  971.  
  972.             <!-- second column is the object -->
  973.             <xsl:if test="not($ot = 'SystemPrivilege')">
  974.                 <td>
  975.                     <a href="#" onclick="FloatMenu_initObj('{$ot}', '{@id}', {$clientrule}, '', '',{$otid}); toggleFloatMenu(this, 'objMenu','table_rules','rules'); return false;">
  976.                         <xsl:apply-templates select="." mode="getObjValue"/>
  977.                     </a>
  978.                 </td>
  979.             </xsl:if>
  980.  
  981.             <!-- third column is the application or app group => if system app, then append $ -->
  982.             <td>
  983.  
  984.                 <a href="#" onclick="FloatMenu_initApp('{@id}','','',{$clientrule}); toggleFloatMenu(this, 'appMenu','table_rules','rules'); return false;">
  985.                     <strong>
  986.                         <xsl:choose>
  987.                             <xsl:when test="@app_id">
  988.                                 <xsl:value-of select="@app_id"/>
  989.                             </xsl:when>
  990.                             <xsl:otherwise>
  991.                                 <xsl:value-of select="@app"/>
  992.                             </xsl:otherwise>
  993.                         </xsl:choose>
  994.                     </strong>
  995.                 </a>
  996.             </td>
  997.  
  998.             <xsl:if test="$accountcolumn='show'">
  999.                 <td>
  1000.                     <xsl:attribute name="title">
  1001.                         <xsl:call-template name="getAccountTip">
  1002.                             <xsl:with-param name="strAccount" select="@account"/>
  1003.                         </xsl:call-template>
  1004.                     </xsl:attribute>
  1005.  
  1006.                     <a href="#" onclick="if (FloatMenu_initAccount('{@id}','','',{$clientrule})) toggleFloatMenu(this, 'accountMenu','table_rules','rules'); return false;">
  1007.                         <xsl:call-template name="getAccountText">
  1008.                             <xsl:with-param name="strAccount" select="@account"/>
  1009.                         </xsl:call-template>
  1010.                     </a>
  1011.                 </td>
  1012.             </xsl:if>
  1013.  
  1014.             <!-- the 4+ columns are accesses => number of accesses is dependent on number of at_XXX parameters-->
  1015.             <xsl:variable name="curr_rule" select="."/>
  1016.  
  1017.             <xsl:for-each select="//Params/Param">
  1018.                 <xsl:if test="starts-with( @name, 'at_')">
  1019.                     <xsl:variable name="curr_atid" select="."/>
  1020.                     <xsl:variable name="curr_at" select="substring-after( @name, 'at_' )"/>
  1021.  
  1022.                     <xsl:apply-templates select="$curr_rule" mode="showAccess">
  1023.                         <xsl:with-param name="atid" select="$curr_atid"/>
  1024.                         <xsl:with-param name="at" select="$curr_at"/>
  1025.                         <xsl:with-param name="ruleid" select="$curr_rule/@id"/>
  1026.                     </xsl:apply-templates>
  1027.                 </xsl:if>
  1028.             </xsl:for-each>
  1029.  
  1030.             <!-- time of day -->
  1031.             <td style="white-space : nowrap;">
  1032.  
  1033.                 <a href="#" onclick="FloatMenu_initTime('{@id}', {$clientrule}, ''); toggleFloatMenu(this, 'timeMenu','table_rules','rules'); return false;">
  1034.                     <xsl:choose>
  1035.                         <xsl:when test="@timeofday_id">
  1036.                             <xsl:value-of select="@timeofday_id"/>
  1037.                         </xsl:when>
  1038.                         <xsl:when test="not(@timeofday='*')">
  1039.                             <xsl:call-template name="formatDaytime">
  1040.                                 <xsl:with-param name="daytime" select="@timeofday"/>
  1041.                             </xsl:call-template>
  1042.                         </xsl:when>
  1043.                     </xsl:choose>
  1044.                 </a>
  1045.             </td>
  1046.  
  1047.             <!-- optional User column -->
  1048.             <xsl:if test="($usercolumn = 'show') or ($usercolumn = 'showempty')">
  1049.                 <td>
  1050.                     <xsl:if test="$usercolumn = 'show'">
  1051.                         <xsl:if test="not($clientrule='true')">
  1052.  
  1053.                             <a href="#" onclick="FloatMenu_initUsers('{@id}', ''); toggleFloatMenu(this, 'usersMenu', 'table_rules', 'rules'); return false;">
  1054.                                 <xsl:call-template name="replaceWithBR">
  1055.                                     <xsl:with-param name="string" select="@filter"/>
  1056.                                     <xsl:with-param name="what" select="'|'"/>
  1057.                                 </xsl:call-template>
  1058.                             </a>
  1059.                         </xsl:if>
  1060.                     </xsl:if>
  1061.                 </td>
  1062.             </xsl:if>
  1063.  
  1064.             <!-- move-to, edit and delete icons-->
  1065.             <xsl:if test="$isButtonsOnLeft!='true'">
  1066.                 <td class="action" style="text-align: right;">
  1067.                     <xsl:apply-templates select="." mode="getBtns">
  1068.                         <xsl:with-param name="priority" select="@priority"/>
  1069.                     </xsl:apply-templates>
  1070.                 </td>
  1071.             </xsl:if>
  1072.         </tr>
  1073.  
  1074.     </xsl:template>
  1075.  
  1076.     <xsl:template match="Rule" mode="detail_readonly">
  1077.         <xsl:param name="className"/>
  1078.         <xsl:param name="simplerule"/>
  1079.  
  1080.         <!-- modify the row background color according to $ or even line -->
  1081.         <tr id="_rule_{@id}" ruleId="{@id}" class="{$className}">
  1082.             <xsl:attribute name="title">
  1083.                 <xsl:apply-templates select="." mode="tooltip">
  1084.                     <xsl:with-param name="detail" select="'true'"/>
  1085.                 </xsl:apply-templates>
  1086.             </xsl:attribute>
  1087.  
  1088.             <!-- first column is the 'rule enable' checkbox + the rule id -->
  1089.             <td>
  1090.                 <input type="checkbox" align="absmiddle" onclick="OnDisableEnableRule( '{@id}', this.checked )">
  1091.                     <xsl:attribute name="title">
  1092.                         <xsl:value-of select="//Params/Param[@name='STR_RULES_ENABLE_TIP']"/>
  1093.                     </xsl:attribute>
  1094.  
  1095.                     <xsl:if test="(@disabled = '0') or not(@disabled)">
  1096.                         <xsl:attribute name="checked"/>
  1097.                     </xsl:if>
  1098.  
  1099.                     <xsl:if test="$readonly='true' or $disableChb='true' or $simplerule='true'">
  1100.                         <xsl:attribute name="disabled"/>
  1101.                     </xsl:if>
  1102.                 </input>
  1103.             </td>
  1104.  
  1105.             <xsl:if test="$showPrefCol='true'">
  1106.                 <td>
  1107.                     <xsl:if test="not($clientrule='true') and (@preferred='1' or @preferred='true')">
  1108.                         <img src="../img/ico-pref.gif">
  1109.                             <xsl:attribute name="title">
  1110.                                 <xsl:value-of select="$STR_TOOLTIP_PREF"/>
  1111.                             </xsl:attribute>
  1112.                         </img>
  1113.                     </xsl:if>
  1114.                 </td>
  1115.             </xsl:if>
  1116.  
  1117.             <!-- move-to, edit and delete icons-->
  1118.             <xsl:if test="$isButtonsOnLeft='true'">
  1119.                 <td class="action" style="text-align: left;">
  1120.                     <xsl:if test="not($readonly='true') and not($simplerule='true')">
  1121.                         <xsl:apply-templates select="." mode="getBtns">
  1122.                             <xsl:with-param name="priority" select="@priority"/>
  1123.                         </xsl:apply-templates>
  1124.                     </xsl:if>
  1125.                 </td>
  1126.             </xsl:if>
  1127.  
  1128.             <!-- second column is the object -->
  1129.             <xsl:if test="not($ot = 'SystemPrivilege')">
  1130.                 <td class="nomenu">
  1131.                     <xsl:apply-templates select="." mode="getObjValue"/>
  1132.                 </td>
  1133.             </xsl:if>
  1134.  
  1135.             <!-- third column is the application or app group => if system app, then append $ -->
  1136.             <td class="nomenu">
  1137.                 <strong>
  1138.                     <xsl:choose>
  1139.                         <xsl:when test="@app_id">
  1140.                             <xsl:value-of select="@app_id"/>
  1141.                         </xsl:when>
  1142.                         <xsl:otherwise>
  1143.                             <xsl:value-of select="@app"/>
  1144.                         </xsl:otherwise>
  1145.                     </xsl:choose>
  1146.                 </strong>
  1147.             </td>
  1148.  
  1149.             <xsl:if test="$accountcolumn='show'">
  1150.                 <td class="nomenu">
  1151.                     <xsl:attribute name="title">
  1152.                         <xsl:call-template name="getAccountTip">
  1153.                             <xsl:with-param name="strAccount" select="@account"/>
  1154.                         </xsl:call-template>
  1155.                     </xsl:attribute>
  1156.  
  1157.                     <xsl:call-template name="getAccountText">
  1158.                         <xsl:with-param name="strAccount" select="@account"/>
  1159.                     </xsl:call-template>
  1160.                 </td>
  1161.             </xsl:if>
  1162.  
  1163.             <!-- the 4+ columns are accesses => number of accesses is dependent on number of at_XXX parameters-->
  1164.             <xsl:variable name="curr_rule" select="."/>
  1165.  
  1166.             <xsl:for-each select="//Params/Param">
  1167.                 <xsl:if test="starts-with( @name, 'at_')">
  1168.                     <xsl:variable name="curr_atid" select="."/>
  1169.                     <xsl:variable name="curr_at" select="substring-after( @name, 'at_' )"/>
  1170.  
  1171.                     <xsl:apply-templates select="$curr_rule" mode="showAccess">
  1172.                         <xsl:with-param name="atid" select="$curr_atid"/>
  1173.                         <xsl:with-param name="at" select="$curr_at"/>
  1174.                         <xsl:with-param name="ruleid" select="$curr_rule/@id"/>
  1175.                         <xsl:with-param name="readonlyloc" select="'true'"/>
  1176.                     </xsl:apply-templates>
  1177.                 </xsl:if>
  1178.             </xsl:for-each>
  1179.  
  1180.             <!-- time of day -->
  1181.             <td style="white-space : nowrap;" class="nomenu">
  1182.                 <xsl:choose>
  1183.                     <xsl:when test="@timeofday_id">
  1184.                         <xsl:value-of select="@timeofday_id"/>
  1185.                     </xsl:when>
  1186.                     <xsl:when test="not(@timeofday='*')">
  1187.                         <xsl:call-template name="formatDaytime">
  1188.                             <xsl:with-param name="daytime" select="@timeofday"/>
  1189.                         </xsl:call-template>
  1190.                     </xsl:when>
  1191.                 </xsl:choose>
  1192.             </td>
  1193.  
  1194.             <!-- optional User column -->
  1195.             <xsl:if test="($usercolumn = 'show') or ($usercolumn = 'showempty')">
  1196.                 <td class="nomenu">
  1197.                     <xsl:if test="$usercolumn = 'show'">
  1198.                         <xsl:if test="not($clientrule='true')">
  1199.                             <xsl:call-template name="replaceWithBR">
  1200.                                 <xsl:with-param name="string" select="@filter"/>
  1201.                                 <xsl:with-param name="what" select="'|'"/>
  1202.                             </xsl:call-template>
  1203.                         </xsl:if>
  1204.                     </xsl:if>
  1205.                 </td>
  1206.             </xsl:if>
  1207.  
  1208.             <!-- move-to, edit and delete icons-->
  1209.             <xsl:if test="$isButtonsOnLeft!='true'">
  1210.                 <td class="action" style="text-align: right;">
  1211.                     <xsl:if test="not($readonly='true') and not($simplerule='true')">
  1212.                         <xsl:apply-templates select="." mode="getBtns">
  1213.                             <xsl:with-param name="priority" select="@priority"/>
  1214.                         </xsl:apply-templates>
  1215.                     </xsl:if>
  1216.                 </td>
  1217.             </xsl:if>
  1218.         </tr>
  1219.  
  1220.     </xsl:template>
  1221.  
  1222.     <xsl:template name="getColumnHeader">
  1223.         <xsl:param name="index"/>
  1224.  
  1225.  
  1226.     </xsl:template>
  1227.  
  1228.     <xsl:template match="Rule" mode="tooltip">
  1229.         <xsl:param name="detail"/>
  1230.  
  1231.         <xsl:choose>
  1232.             <xsl:when test="not($detail='true')">
  1233.  
  1234.                 <xsl:if test="not($ot = 'SystemPrivilege')">
  1235.                     <xsl:value-of select="$editobjhdr"/><xsl:text>: </xsl:text>
  1236.                     <xsl:choose>
  1237.                         <xsl:when test="Object">
  1238.                             <xsl:value-of select="Object"/>
  1239.                         </xsl:when>
  1240.                         <xsl:otherwise>
  1241.                             <xsl:value-of select="@obj_id"/>
  1242.                         </xsl:otherwise>
  1243.                     </xsl:choose>
  1244.                     <xsl:text disable-output-escaping="no"> </xsl:text>
  1245.                 </xsl:if>
  1246.  
  1247.  
  1248.                 <xsl:choose>
  1249.                     <xsl:when test="$ot='DllLoading'">
  1250.                         <xsl:value-of select="//Params/Param[@name='STR_CH_LOAD_BY']"/>
  1251.                     </xsl:when>
  1252.                     <xsl:when test="$ot='Spawning'">
  1253.                         <xsl:value-of select="//Params/Param[@name='STR_CH_START_BY']"/>
  1254.                     </xsl:when>
  1255.                     <xsl:otherwise>
  1256.                         <xsl:value-of select="//Params/Param[@name='STR_CH_APP']"/>
  1257.                     </xsl:otherwise>
  1258.                 </xsl:choose>
  1259.                 <xsl:text>: </xsl:text>
  1260.  
  1261.                 <xsl:choose>
  1262.                     <xsl:when test="@app_id">
  1263.                         <xsl:value-of select="@app_id"/>
  1264.                     </xsl:when>
  1265.                     <xsl:otherwise>
  1266.                         <xsl:value-of select="@app"/>
  1267.                     </xsl:otherwise>
  1268.                 </xsl:choose>
  1269.                 <xsl:text disable-output-escaping="no"> </xsl:text>
  1270.  
  1271.  
  1272.                 <xsl:variable name="curr_rule" select="."/>
  1273.  
  1274.                 <xsl:for-each select="//Params/Param">
  1275.                     <xsl:if test="starts-with( @name, 'at_')">
  1276.                         <xsl:variable name="curr_atid" select="."/>
  1277.                         <xsl:variable name="curr_at" select="substring-after( @name, 'at_' )"/>
  1278.                         <xsl:variable name="curr_atHdr" select="concat($curr_at,'ColHdr')"/>
  1279.  
  1280.                         <xsl:value-of select="//Params/Param[@name=$curr_atHdr]"/><xsl:text>: </xsl:text>
  1281.  
  1282.                         <xsl:apply-templates select="$curr_rule" mode="showAccessTooltip">
  1283.                             <xsl:with-param name="atid" select="$curr_atid"/>
  1284.                             <xsl:with-param name="at" select="$curr_at"/>
  1285.                         </xsl:apply-templates>
  1286.  
  1287.                         <xsl:text disable-output-escaping="no"> </xsl:text>
  1288.                     </xsl:if>
  1289.                 </xsl:for-each>
  1290.  
  1291.  
  1292.                 <xsl:value-of select="//Params/Param[@name='STR_CH_TIME']"/><xsl:text>: </xsl:text>
  1293.                 <xsl:choose>
  1294.                     <xsl:when test="@timeofday_id">
  1295.                         <xsl:value-of select="@timeofday_id"/>
  1296.                     </xsl:when>
  1297.                     <xsl:when test="not(@timeofday='*')">
  1298.                         <xsl:call-template name="formatDaytime">
  1299.                             <xsl:with-param name="daytime" select="@timeofday"/>
  1300.                         </xsl:call-template>
  1301.                     </xsl:when>
  1302.                 </xsl:choose>
  1303.                 <xsl:text disable-output-escaping="no"> </xsl:text>
  1304.  
  1305.  
  1306.                 <xsl:if test="($usercolumn = 'show') or ($usercolumn = 'showempty')">
  1307.  
  1308.                     <xsl:if test="$usercolumn='show' and not($clientrule='true')">
  1309.                         <xsl:value-of select="//Params/Param[@name='STR_CH_USER']"/><xsl:text>: </xsl:text>
  1310.  
  1311.                         <xsl:call-template name="replace">
  1312.                             <xsl:with-param name="string" select="@filter"/>
  1313.                             <xsl:with-param name="what" select="'|'"/>
  1314.                             <xsl:with-param name="with" select="', '"/>
  1315.                         </xsl:call-template>
  1316.  
  1317.                     </xsl:if>
  1318.  
  1319.                 </xsl:if>
  1320.  
  1321.             </xsl:when>
  1322.  
  1323.             <xsl:otherwise>
  1324.                 <xsl:choose>
  1325.                     <xsl:when test="$ot = 'File' and starts-with( @desc, '@@:')">
  1326.                         <xsl:value-of select="//Params/Param[@name='STR_FRS_CANNOT_EDIT']"/>
  1327.                     </xsl:when>
  1328.                     <xsl:otherwise>
  1329.                         <xsl:value-of select="@desc"/>
  1330.                     </xsl:otherwise>
  1331.                 </xsl:choose>
  1332.             </xsl:otherwise>
  1333.         </xsl:choose>
  1334.  
  1335.     </xsl:template>
  1336.  
  1337.     <!-- template Params mode=allaccesses => used to construct variable $allaccesses to be used for OnEditRule call -->
  1338.     <xsl:template match="Params" mode="allaccesses">
  1339.         <xsl:for-each select="Param[starts-with( @name, 'at_')]">
  1340.             <xsl:if test="not(position() = 1)">
  1341.                 <xsl:text>&</xsl:text>
  1342.             </xsl:if>
  1343.             <xsl:value-of select="@name"/>
  1344.             <xsl:text>=</xsl:text>
  1345.             <xsl:value-of select="self::*"/>
  1346.         </xsl:for-each>
  1347.     </xsl:template>
  1348.  
  1349. </xsl:stylesheet>
  1350.